package luj.tool.jnproxyan.proxy.network.direct.state;

import io.netty.channel.Channel;
import io.netty.util.AttributeKey;

public class P2sConnAttr {

  public P2sConnAttr(Channel channel) {
    _channel = channel;
  }

  public void init(P2sConn state) {
    _channel.attr(KEY).set(state);
  }

  public P2sConn get() {
    return _channel.attr(KEY).get();
  }

  private static final AttributeKey<P2sConn> KEY = AttributeKey.valueOf("proxy.p2s.conn");

  private final Channel _channel;
}
